package com.lj.service;

import com.lj.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;

@Service
public class UserTask {

    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");

    @Autowired
    private UserDao userdao;

    @Scheduled(cron = "0 0 2 * * ?")
    public void myTask(){
        userdao.findUsersTimes();
    }

}
